home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ====================================================================== DESC: Common Report Functions for the Administer Operations PLATFORMS: >= MS IE 4.0 USAGE NOTES: ====================================================================== */ var SCbsy = false; var PuPW = "400px", PuPWu=400, PuPH = "130px", PuPHu=270, PuPCH = "235px"; function processSizeChange() { if ( SCbsy ) return; SCbsy = true; // Display Height and Width bCh = document.body.clientHeight; bCw = document.body.clientWidth; // Minimums bCh = (bCh < bdH+byM+240) ? bdH+byM+240 : bCh; bCw = (bCw < 330) ? 330 : bCw; document.body.scroll = (bCw <= 330 || bCh <= bdH+byM+240) ? "yes" : "no"; // PopUp PuPLeft = (bCw-PuPWu)/2; PuPTop = (bCh-PuPHu)/2; PopUpDiv.style.left = PuPLeft+"px"; PopUpDiv.style.top = "85px"; //PuPTop+"px"; PopUpDiv.style.height = PuPH; PopUpDiv.style.width = PuPW; PuPLeft = (bCw-530)/2; PuPTop = (bCh-450)/2; PopUpNew.style.left = PuPLeft+"px"; PopUpNew.style.top = "5px"; //PuPTop+"px"; PopUpNew.style.height = "450px"; PopUpNew.style.width = "530px"; PuPLeft = (bCw-400)/2; PopUpExclude.style.left = PuPLeft+"px"; PopUpExclude.style.top = "5px"; //PuPTop+"px"; PopUpExclude.style.height = "450px"; PopUpExclude.style.width = "400px"; //PopUpContext Menu PopUpContextSize(bCw); // Set Height/Widths for Chart and Button areas GTabBx.style.height = bCh-(bdH+byM-borderSz)-10; GTabBx.style.width = bCw-byM-12; GTab.style.top = bCh-(bdH+byM-borderSz)-90; ResultsRUI.style.height = SchedRUI.style.height = GTabBx.style.posHeight-TitleDivSize; ResultsRUI.style.width = SchedRUI.style.width = GTab.style.width = GTabBx.style.posWidth-28; ResultRwin1.style.height = SchedRwin.style.height = SchedRUI.style.posHeight-TitleDivSize-15; ResultRwin1.style.width = SchedRwin.style.width = SchedRUI.style.posWidth-15; GTabBx.style.display = ""; // PopUp PupSLeft = (bCw <= 500) ? 0 : (bCw-500)/2; PopUpSelectDiv.style.left = PupSLeft+"px"; PopUpSelectDiv.style.top = "40px"; //PuPTop+"px"; PopUpSelectDiv.style.height = GTabBx.style.posHeight-60; PopUpSelectDiv.style.width = "500px"; AL_CCOneAlertGroup.style.height = GTabBx.style.posHeight-120; SchedReportTab.className="STabUnsel"; ResultsReportTab.className="STabUnsel"; document.all[CurSelTab].className="STabSel"; if ( SrsObjArr.length == 0 && CurSelTab == "SchedReportTab") { outputReportsStatusTextBox(); } SCbsy = false; } /* Initiate Lookup of Currently Scheduled Reports */ function processVRLookupReset() { SrsObjArr.length = 0; SchedRwin.innerHTML = ""; //clear display before clearing store SchedRptLupRecCount = 0; // clear Lookup record counter if ( RpmCC_VR.WSHLookupName("*") ) { VRMode = ""; top.Rstatus.Pstat("Unable to start the SCHEDULED REPORT LOOKUP request",true); } else { VRMode = "LookupSchedReport"; // set Mode of operation top.Rstatus.Pstat("One moment while SCHEDULED REPORT LOOKUP request completes"); SetCursor("wait"); top.banner.processStartComm(); } } /* Process WSH Add Op Complete */ function processWSHOpComplete() { if (VRMode == "LookupSchedReport") { VRMode = ""; // reset if (SchedRptLupRecCount == 0) { // check if any records found top.Rstatus.Pstat("No record matches found for SCHEDULED REPORT LOOKUP request",true); } else { top.Rstatus.Pstat("Request Completed"); if ( DeleteSpecialReports == true ) { // if flag to delete any "Inventory" report results DeleteSpecialReports = false; // reset for ( var i=0; i<SrsObjArr.length; i+=SchedReportRecLength ) { // if special "Inventory" report and Report results exists if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 && SrsObjArr[i+12] == AComplete) { SrsObjArr[i+12] = ANotStarted; // Set Started State wshid = SrsObjArr[i+0]; // get Report ID RpmCC_VR.WSHDeleteHTML(wshid); // Delete existing Analysis report first } } } } outputReportsStatusTextBox(); if ( ComServcsLookupRqd ) { ComServcsLookupRqd = false; AlertLupRecCount = 0; // clear Lookup record counter AlertRec_Arr.length = 0; // clear if ( RpmCC_VR.AlertGroupLookup("*") ) { top.Rstatus.Pstat("Unable to start the Alert LOOKUP request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while Alert LOOKUP request completes"); } } else { CursorReset(); } } else if ( VRMode == "RemoveSchedReport" ) { if ( --DeleteCount <= 0 ) outputReportsStatusTextBox(); // go redisplay checkEnableDisable(); } else { top.Rstatus.Pstat("Request Completed"); } } function CursorReset() { SetCursor("auto"); top.banner.processStopCommX(); } function CursorWait() { SetCursor("wait"); top.banner.processStartComm(); } // Alert Lookup Record var AlertRecLength = 5; var AlertLupRecCount = 0; function processAlertLupRec(AlID, AlName, AlDesc, AlSDT) { var i = AlertLupRecCount * AlertRecLength; var CurrentAlertType = "C"; // set Counter type if ( AlSDT == "01/01/1999 11:50:00" || AlSDT == "1/1/1999 11:50:0" ) { // if User CurrentAlertType = "U"; // "User" type } else if ( AlSDT == "01/01/1999 11:40:00" || AlSDT == "1/1/1999 11:40:0" ) { CurrentAlertType = "E"; // "Event Log" type } else if ( AlSDT == "01/01/1999 11:20:00" || AlSDT == "1/1/1999 11:20:0" ) { CurrentAlertType = "T"; // "SNMP Trap" type } else if ( AlSDT == "01/01/1999 11:10:00" || AlSDT == "1/1/1999 11:10:0" ) { CurrentAlertType = "W"; // "Win Service" type } else if ( AlSDT == "01/01/1999 11:00:00" || AlSDT == "1/1/1999 11:0:0" ) { CurrentAlertType = "F"; // "File Check" type } else if ( AlSDT == "01/01/1999 11:12:00" || AlSDT == "1/1/1999 11:12:0" ) { CurrentAlertType = "P"; // "Process Check" type } else if ( AlSDT == "01/01/1999 11:15:00" || AlSDT == "1/1/1999 11:15:0" ) { CurrentAlertType = "L"; // "SYSLOG Check" type } else if ( AlSDT == "01/01/1999 11:30:00" || AlSDT == "1/1/1999 11:30:0" ) { // Service type CurrentAlertType = "S"; // "Service" type } else // ignore return; // Parse Out Dependency, MaxAlerts etc. var warr = new Array(); warr = AlDesc.split("[]"); AlDesc = warr[0]; AlertRec_Arr[i++] = AlID; AlertRec_Arr[i++] = AlName; AlertRec_Arr[i++] = AlDesc; AlertRec_Arr[i++] = CurrentAlertType; AlertRec_Arr[i] = 0; ++AlertLupRecCount; } /* Alert Lookup Op Complete */ function processAlertOpComplete() { if (AlertLupRecCount == 0) { // check if any records found top.Rstatus.Pstat("No record matches found for Watch/Alert LOOKUP request",true); CursorReset(); } else { // Do Services Lookup ServicesRecCount = 0; // reset count Services_Arr.length = 0; rstat = RpmCC_VR.ServicesLookup("","","ComputerID,ID DESC"); if ( rstat ) { // if unable to initiate request top.Rstatus.Pstat("Unable to start the Services LOOKUP request",true); CursorReset(); } else { // waiting for OperationCompleteEvent top.Rstatus.Pstat("One moment while Services LOOKUP request completes"); return; } } } function processAlertOpError() { top.Rstatus.Pstat("Error in Watch/Alert Lookup"); } // Process Serverices LOOKUP Record Event var ServicesRecCount = 0; var ServicesRecLength = 4; // Services Lookup record length function processServicesRecord(SRVstrg) { var warr = new Array(); warr = SRVstrg.split("~"); var j = ServicesRecCount * ServicesRecLength; Services_Arr[j] = warr[1]; // Computer ID Services_Arr[j+1] = warr[2]; // AlertGroup ID warr[3] = (warr[3] == "SQLCONNECT") ? "SQL" : warr[3]; Services_Arr[j+2] = warr[3]; // Type Services_Arr[j+3] = SRVstrg; ++ServicesRecCount; // bump record counter } // Process Services Operation Complete Event function processServicesOpComplete() { // Initiate Computer Lookup CompRecCount = 0; // initialize the count AC_CompStoreArr.length = 0; if ( RpmCC_VR.ComputerLookup("*","*") ) { top.Rstatus.Pstat("Unable to start the Computer LOOKUP request",true); CursorReset(); } else { // waiting for OperationCompleteEvent top.Rstatus.Pstat("One moment while Computer LOOKUP request completes"); } } function processServicesOpError() { top.Rstatus.Pstat("Error in IP Services Lookup"); } var CompRecLength = 5; var CompRecCount = 0; function processCompAddToStore(CNme,CDesc,Cid,Gid) { var i = CompRecCount * CompRecLength; AC_CompStoreArr[i++] = Cid; AC_CompStoreArr[i++] = Gid; AC_CompStoreArr[i++] = CNme; AC_CompStoreArr[i++] = CDesc; AC_CompStoreArr[i++] = "0"; // "S" ++CompRecCount; } function processComputerLookupComplete() { // Initiate SyslogCheck Lookup SyslogCheck_Arr.length = 0; if ( RpmCC_VR.SyslogCheckLookup("*") ) { top.Rstatus.Pstat("Unable to start the SYSLOGWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while SYSLOGWatch lookup request completes"); } } function processComputerOpError() { top.Rstatus.Pstat("Error in Server/Computer Lookup"); } var SyslogCheck_Arr = new Array(); var SyslogCheckRecLength = 2; function processSLLookupOpComplete(SLLStat) { var wrkarr = new Array(); wrkarr = SLLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { SyslogCheck_Arr = SLLStat.split("~"); // parse the lookup record } // Get Process Check Watches ProcessCheck_Arr.length = 0; if ( RpmCC_VR.ProcessCheckLookup("*") ) { top.Rstatus.Pstat("Unable to start the ProcessWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while ProcessWatch lookup request completes"); } } var ProcessCheck_Arr = new Array(); var ProcessCheckRecLength = 2; function processPCLookupOpComplete(FCLStat) { var wrkarr = new Array(); wrkarr = FCLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { ProcessCheck_Arr = FCLStat.split("~"); // parse the lookup record } // Get File Check Watches FileCheck_Arr.length = 0; if ( RpmCC_VR.FileCheckLookup("*") ) { top.Rstatus.Pstat("Unable to start the FileWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while FileWatch lookup request completes"); } } var FileCheck_Arr = new Array(); var FileCheckRecLength = 2; function processFCLookupOpComplete(FCLStat) { var wrkarr = new Array(); wrkarr = FCLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { FileCheck_Arr = FCLStat.split("~"); // parse the lookup record } // Get Win Services Watches WinSCheck_Arr.length = 0; if ( RpmCC_VR.NTServicesMonitorLookupAGID("*") ) { top.Rstatus.Pstat("Unable to start the WinServicesWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while WinServicesWatch lookup request completes"); } } var WinSCheck_Arr = new Array(); var WinSCheckRecLength = 2; function processNTSMLookupOpComplete(NTSMLStat) { var wrkarr = new Array(); wrkarr = NTSMLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { WinSCheck_Arr = NTSMLStat.split("~"); // parse the lookup record } // Get SNMP Trap Watches SNMPCheck_Arr.length = 0; if ( RpmCC_VR.SnmpTrapMonitorFindByAGId("*") ) { top.Rstatus.Pstat("Unable to start the SNMPTrapWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while SNMPTrapWatch lookup request completes"); } } var SNMPCheck_Arr = new Array(); var SNMPCheckRecLength = 2; function processSNMPLookupOpComplete(SNMPLStat) { var wrkarr = new Array(); wrkarr = SNMPLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { SNMPCheck_Arr = SNMPLStat.split("~"); // parse the lookup record } // Get Event Log Watches EventLCheck_Arr.length = 0; if ( RpmCC_VR.ELMonitorLookupByAlertGroup("*") ) { top.Rstatus.Pstat("Unable to start the EventLogWatch lookup request",true); CursorReset(); } else { top.Rstatus.Pstat("One moment while EventLogWatch lookup request completes"); } } var EventLCheck_Arr = new Array(); var EventLCheckRecLength = 2; function processEVLookupOpComplete(EVLStat) { var wrkarr = new Array(); wrkarr = EVLStat.split(":"); // parse the lookup record if ( wrkarr[0] != "Err" ) { EventLCheck_Arr = EVLStat.split("~"); // parse the lookup record } // Done Lookups top.Rstatus.Pstat("Request Completed"); CursorReset(); } function processELMonitorOpError() { // Done Lookups top.Rstatus.Pstat("Request Completed"); CursorReset(); } // Process Unsolicited Status Change Event for a Report function processWSHStatusChange(wsid,wsstat) { if ( AnalysisBusy || wsstat == SHTMLDeleted) { return; // ignore these for now } if (SchedRUI.style.display == "") { // if Schedule Report box displayed var k=SrsObjArr.length; // length status display for ( var i=0; i<SrsObjArr.length; i+=SchedReportRecLength ) { if ( SrsObjArr[i] == wsid) { // match ID in store with Status Change event if ( wsstat == SDeleted ) { var idx = i; // index to record to be deleted for (var m = idx+SchedReportRecLength; m < SrsObjArr.length; ++m, ++idx) { SrsObjArr[idx] = SrsObjArr[m]; } SrsObjArr.length -= SchedReportRecLength; } else if ( SrsObjArr[i+4] != wsstat) { // Status different SrsObjArr[i+4] = wsstat; // update status if (wsstat == SCompleted) { SrsObjArr[i+12] = ANotStarted; } } if ( wsstat == SDeleted ) { break; //if ( --DeleteCount > 0 ) break; } outputReportsStatusTextBox(); // go redisplay break; } } if ( i>=k ) { // if not found, must be new entry top.Rstatus.Pstat("Unsolicited Report Status Change received"); processVRLookupReset(); // go lookup current schedule reports } } } // Process Unsolicited Status Change Event for a ReportAnalysis being Generated function processAnalyzeStatusChange() { if (SchedRUI.style.display == "") { // if Schedule Report box displayed outputReportsStatusTextBox(); } } /* Process Click on selected Tab */ var CurSelTab = "SchedReportTab"; // current selected tab var RTid = null; function processGeneralClick(th) { if ( th.style.cursor =="auto" ) return; // ignore disabled top.Rstatus.Pstat(""); SchedRUI.style.display="none"; ResultsRUI.style.display="none"; SchedReportTab.className="STabUnsel"; ResultsReportTab.className="STabUnsel"; th.className="STabSel"; CurSelTab = th.id; switch ( th.id ) { case "SchedReportTab" : SchedRUI.style.display=""; // Enable this Tab's view outputReportsStatusTextBox(); break; case "ResultsReportTab" : document.all.ResultIF1.src = ""; // clear report results RTid = setTimeout("processRTab()",100); // Delay 100 ms. break; } } function processRTab() { RTid = null; ResultsRUI.style.display=""; // Enable this Tab's view processResultTabInit(); // Go set up Result windows } // Initialize Result Tab windows var RptAr = new Array(); // Current Selected Report Array var RptIx = 0; // Current Selected Report Index function processResultTabInit() { // Get all selected that are Completed RptAr.length = 0; // reset Report array RptIx = 0; // initialize index var i=(-1), j=0;// initialize search while ( (i = getNextSelected(i)) != -1 ) { if ( SrsObjArr[i+12] == AComplete ) { RptAr[j++] = SrsObjArr[i+10]; // get Report URL } } // Check if at least one report if ( j > 0 ) { DisplayReport(); // go display first selected report } } // Display Specified Report from Selected Report Array function DisplayReport() { document.all.ResultIF1.src = RptAr[RptIx]; // show report results // Set Next and previous buttons accordingly var nflg = (RptIx < RptAr.length-1) ? 1 : 0; var pflg = (RptIx > 0) ? 1 : 0; //RNextBut.className = (nflg) ? "SBoxButton" : "SBoxButtonD"; //RPrevBut.className = (pflg) ? "SBoxButton" : "SBoxButtonD"; RNextBut.disabled = (nflg) ? "" : "disabled"; RPrevBut.disabled = (pflg) ? "" : "disabled"; } // Process Next and Previous Report Results Buttons function processResultsNext() { ++RptIx; // bump to Next report DisplayReport(); // go display it } function processResultsPrevious() { --RptIx; // bump to Previous report DisplayReport(); // go display it } /* Update Scheduled report Status Box */ var DisplayCount = 0; var RptCount = 0; var LineCount = 0; function outputReportsStatusTextBox() { RptCount = 0; LineCount = 0; CursorWait(); outputReportsStatusTextBoxContinue(); } function outputReportsStatusTextBoxContinue() { Tid = null; var sob = ""; var i = RptCount; var j = LineCount; var DtArr = new Array(); var DeArr = new Array(); var Parr = new Array(); var Narr = new Array(); spec_dt = "<font color='blue'>--------------</font>"; // D/T for "Inventory" reports if ( RptCount == 0 ) { SchedRwin.innerHTML = ""; //clear display sob = "<table border='0' cellpadding='0' cellSpacing='1' width='1100' id='table'>"; sob += "<tr><td width='25%' align='center' class='optextb' style='background-color:activeborder'>" + "Report Name" + "</td>"; sob += "<td width='10%' align='center' class='optextb' style='background-color:activeborder'>" + "Analysis Status" + "</td>"; sob += "<td width='7%' align='center' style='background-color:activeborder' class='optextb'>" + "Start Date" + "</td>"; sob += "<td width='6%' align='center' style='background-color:activeborder' class='optextb'>" + "Start Time" + "</td>"; sob += "<td width='7%' align='center' style='background-color:activeborder' class='optextb'>" + "End Date" + "</td>"; sob += "<td width='6%' align='center' style='background-color:activeborder' class='optextb'>" + "End Time" + "</td>"; sob += "<td width='39%' align='center' class='optextb' style='background-color:activeborder'>" + "Last Status Message" + "</td></tr>"; } else { sob = "<table border='0' cellpadding='0' cellSpacing='1' width='1100' id='table"+i+"'>"; } for ( var loopcount = 0; i<SrsObjArr.length && loopcount < 25; i+=SchedReportRecLength ) { // Check if Show All or only the Completed if ( ShowAllEnabled.checked == false && SrsObjArr[i+4] != SCompleted) { continue; } // If show all enabled and Not "SCompleted" if (SrsObjArr[i+4] == SScheduled) SrsObjArr[i+12] = AMonSched; else if (SrsObjArr[i+4] == SMonitor) SrsObjArr[i+12] = AMonProc; //else if (SrsObjArr[i+4] == SCompleted) // SrsObjArr[i+12] = ANotStarted; sob += "<tr style='cursor:hand' onclick='processRSClick(\"row" + i + "\")'"; if ( SrsObjArr[i+15] == 1 ) { // if selected sob += " style='background-color:scrollbar' "; } else if ( j % 2 ) { sob += " style='background-color:e8e8e8' "; } sob += ( j % 2 ) ? " rescol='e8e8e8' " : " rescol='white' "; sob += " ondblclick='processRSDblClick(\"row" + i +"\")' id='row" + i + "'>"; sob += "<td width='25%' class='optext' title='"; sob += SrsObjArr[i+2] + "'"; if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report sob += " style='color:blue' "; } var NApend = ""; if ( SrsObjArr[i+9].length > 0 ) { Parr = SrsObjArr[i+9].split("[]"); // Get Scedule Parameters if ( Parr.length > 12 ) { Narr = Parr[12].split(":"); NApend = "-"+Narr[0]; } } sob += ">" + SrsObjArr[i+1] + NApend + "</td>"; sob += "<td width='10%' class='optext'"; if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report sob += " style='color:blue' "; } sob += ">" + AnalyzeProcArray[SrsObjArr[i+12]] + "</td>"; DtArr = SrsObjArr[i+7].split(" "); // Split out Start Date and Time DeArr = DtArr[0].split("/"); // Split out m/d/y d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0]; d += "/" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]); d += "/" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]); if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report d = spec_dt; } sob += "<td width='7%' class='optext'>" + d + "</td>"; DeArr = DtArr[1].split(":"); // Split out h:m:s d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0]; d += ":" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]); d += ":" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]); if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report d = spec_dt; } sob += "<td width='6%' class='optext'>" + d + "</td>"; DtArr = SrsObjArr[i+8].split(" "); // Split out End Date and Time DeArr = DtArr[0].split("/"); // Split out m/d/y d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0]; d += "/" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]); d += "/" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]); if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report d = spec_dt; } sob += "<td width='7%' class='optext'>" + d + "</td>"; DeArr = DtArr[1].split(":"); // Split out h:m:s d = (DeArr[0].length == 1) ? "0"+DeArr[0] : DeArr[0]; d += ":" + ((DeArr[1].length == 1) ? "0"+DeArr[1] : DeArr[1]); d += ":" + ((DeArr[2].length == 1) ? "0"+DeArr[2] : DeArr[2]); if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report d = spec_dt; } sob += "<td width='6%' class='optext'>" + d + "</td>"; sob += "<td width='39%' class='optext'"; if ( SrsObjArr[i+14] == 1 ) { // if last message is error sob += " style='color:red'"; // highlight in red } else if ( SrsObjArr[i+3] == 0 && SrsObjArr[i+9] == 0 ) { // if special preloaded "Inventory" report sob += " style='color:blue'"; } sob += ">" + SrsObjArr[i+13] + "</td></tr>"; ++j; ++loopcount; } DisplayCount = j; if ( SrsObjArr.length == 0 ) { sob += "<tr><td colspan='7' width='"+ ResultsRUI.style.posWidth + "' align='center' style='color:red' class='optextn'>" + "No Reports Found" + "</td></tr>"; } sob += "</table>"; SchedRwin.insertAdjacentHTML("beforeEnd",sob); checkEnableDisable(); // check buttons and result tab enable/disabled RptCount = i; LineCount = j; if ( i < SrsObjArr.length ) { // continue if not done Tid = setTimeout("outputReportsStatusTextBoxContinue()",50); // delay 50 ms. then continue } else { SetButtonState(RefreshButton,"0"); CursorReset(); top.Rstatus.Pstat("Request Completed"); } } // Process and Display the Group:Computer Tree var CCEs = null; var GroupExpandedCount = 0; var GroupDisplayedCount = 0; var LastGroupDisplayed = 0; var CurrentServiceDisplayed = ""; function processAlertGroupTree() { var tstrg = "Watch/Alert : Servers/Devices Tree"; if ( RPRtyp == "[2]" ) { AllServersSelected1.checked = "checked"; AllServersSelected1.disabled = "disabled"; } else { var ST = ServiceTypes[ServiceSelect.selectedIndex]; if ( ST == CurrentServiceDisplayed ) return; CurrentServiceDisplayed = ST; AllServersSelected.checked = "checked"; AllServersSelected.disabled = "disabled"; } CompSelectedArr = ""; var Op = AL_CCOneAlertGroup; // preset Op.innerHTML = ""; // reset setOutHeader(tstrg); // define output table header for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { AC_CompStoreArr[j+4] = 0; // reset selected } /* Format and Output Service tree list */ GroupExpandedCount = 0; // init GroupDisplayedCount = 0; for ( var i=0; i<AlertLupRecCount; i++) { if ( !checkIncludedWatch(i) ) { continue; } CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'><tr title='"+ AlertRec_Arr[(i*AlertRecLength)+2] +"'><td width='25'> </td>"; Iprefx = ( i+1 >= AlertLupRecCount ) ? "L" : "T"; CCEs += "<td width='19' align='center'><img id='lima" + GroupDisplayedCount + "' expanded='0' src='images/" + Iprefx + "plus.gif' style='cursor:hand' onclick='procGrpImgClick(this)' width='19' height='20'></td>"; CCEs += "<td width='19' align='center'><img id='limb" + GroupDisplayedCount + "' src='images/CloseImg.gif' style='cursor:hand' onclick='procGrpImgClick(this)' width='15' height='14' "; CCEs += "></td><td width='*' class='optext'>" + AlertRec_Arr[(i*AlertRecLength)+1] + "</td></tr></table>"; CCEs += "<div id='lexp" + GroupDisplayedCount + "' agix="+i+" compcount=0></div>"; LastGroupDisplayed = GroupDisplayedCount; ++GroupDisplayedCount; } if ( GroupDisplayedCount == 0 ) { CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; CCEs += "<tr><td width='25'> </td>"; if ( RPRtyp == "[2]" ) { CCEs += "<td width='19' height='20' align='center'></td><td colspan='2' width='*' class='optextb'>No Watches/Alerts defined for the selected Watch/Alert Types</td></tr></table>"; } else { CCEs += "<td width='19' height='20' align='center'></td><td colspan='2' width='*' class='optextb'>No Watches/Alerts defined for the IP Service: "+ST+" </td></tr></table>"; } } else { if ( Iprefx == "T" ) { var lindx = CCEs.lastIndexOf("Tplus"); if ( lindx != -1 ) { var eCCE = CCEs.substring(0, lindx); eCCE += "L"; eCCE += CCEs.substring(lindx+1) CCEs = eCCE; } } } Op.insertAdjacentHTML("beforeEnd",CCEs); } function checkIncludedWatch(cindex) { var i = cindex; var CAT = AlertRec_Arr[(i*AlertRecLength)+3]; if ( RPRtyp == "[2]" ) { if ((Report_SWA.checked && CAT == "S") || (Report_SNMP.checked && CAT == "T") || (Report_EL.checked && CAT == "E") || (Report_WS.checked && CAT == "W") || (Report_SL.checked && CAT == "L") || (Report_PC.checked && CAT == "P") || (Report_FC.checked && CAT == "F") ) return true; } else { if ( CAT == "S" && checkServiceType( AlertRec_Arr[(i*AlertRecLength)] ) ) // Service type return true; } return false; } function checkServiceType(agid) { var ST = ServiceTypes[ServiceSelect.selectedIndex]; for ( var i=0; i<Services_Arr.length; i+= ServicesRecLength ) { if ( Services_Arr[i+1] == agid && Services_Arr[i+2] == ST ) { return true; } } return false; } /* Display Header for Service and Object:Counter Trees */ function setOutHeader(Tstrg) { CCEs = "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; CCEs += "<tr><td width='25'> </td>"; CCEs += "<td width='19' height='20' align='center'><img src='images/topopen.gif' width='19' height='20'></td><td colspan='2' width='*' class='optextb'>" + Tstrg + "</td></tr></table>"; } // Process Click on Group in Group Tree var CurExpGroupIx = null; // Index to Current Expanded Group var CurCmpIx = 0; var CmpsExpected = 0; var CSortArr = new Array(); var EOBj = null; function procGrpImgClick(SIm) { isx = SIm.id; if ( isx.charAt(0) != "l" ) { // if not a "limaxx" top.banner.beep(); return; } var cx = isx.substring(4,isx.length); // Strip off index CurExpGroupIx = parseInt(cx,10); CObj = document.all["lima"+cx]; EObj = document.all["lexp"+cx]; FObj = document.all["limb"+cx]; Cpfx = (CurExpGroupIx == LastGroupDisplayed) ? "L" : "T"; if ( CObj.expanded == "1" ) { // if currently expanded FObj.src = "images/CloseImg.gif"; CObj.src = "images/" + Cpfx + "plus.gif"; EObj.style.display = "none"; CObj.expanded = "0"; // Set contracted GroupExpandedCount -= EObj.compcount; // decrement count of open computers } else { // otherwise Expand FObj.src = "images/OpenImg.gif"; CCEs = ""; // initialize CObj.src = "images/" + Cpfx + "minus.gif"; CObj.expanded = "1"; // Set expanded if ( EObj.compcount == 0 ) { CmpsExpected = CurCmpIx = 0; // initialize var AGID = AlertRec_Arr[(EObj.agix*AlertRecLength)]; // get Alert Group ID var AGType = AlertRec_Arr[(EObj.agix*AlertRecLength)+3]; // get Alert Group Type // Add Computers to the Tree for This Alert Group CSortArr.length = 0; // reset switch ( AGType ) { case "S" : // Find each service that matches Alert Group ID for ( var i=0; i<Services_Arr.length; i+= ServicesRecLength ) { if ( Services_Arr[i+1] == AGID ) { // Get computer ID from Service entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( Services_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "L" : // Find each Syslog Check that matches Alert Group ID for ( var i=0; i<SyslogCheck_Arr.length; i+= SyslogCheckRecLength ) { if ( SyslogCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( SyslogCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "F" : // Find each File Check that matches Alert Group ID for ( var i=0; i<FileCheck_Arr.length; i+= FileCheckRecLength ) { if ( FileCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( FileCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "P" : // Find each Process Check that matches Alert Group ID for ( var i=0; i<ProcessCheck_Arr.length; i+= ProcessCheckRecLength ) { if ( ProcessCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( ProcessCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "W" : // Find each WinService Check that matches Alert Group ID for ( var i=0; i<WinSCheck_Arr.length; i+= WinSCheckRecLength ) { if ( WinSCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( WinSCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "T" : // Find each SNMPTRap Check that matches Alert Group ID for ( var i=0; i<SNMPCheck_Arr.length; i+= SNMPCheckRecLength ) { if ( SNMPCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( SNMPCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; case "E" : // Find each EventLog Check that matches Alert Group ID for ( var i=0; i<EventLCheck_Arr.length; i+= EventLCheckRecLength ) { if ( EventLCheck_Arr[i+1] == AGID ) { // Get computer ID from entry for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { // if match on Computer ID if ( EventLCheck_Arr[i] == AC_CompStoreArr[j] ) { CSortArr[CmpsExpected++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+j; break; } } } } break; } CSortArr.sort(); var warr = new Array(); for ( var i=0, j=0; i<CmpsExpected; i++ ) { warr = CSortArr[i].split("~"); j = parseInt(warr[1],10); processTreeComputer(j,AGID,AGType); } var lindx = CCEs.lastIndexOf("T.gif"); if ( lindx != -1 ) { var eCCE = CCEs.substring(0, lindx); eCCE += "L"; eCCE += CCEs.substring(lindx+1) CCEs = eCCE; } EObj.compcount = CmpsExpected; // set number computers opened EObj.insertAdjacentHTML("beforeEnd",CCEs); } GroupExpandedCount += EObj.compcount; // increment total number of computers opened EObj.style.display = ""; CObj.scrollIntoView(true); } // enable SelectAll/UnselectAll buttons if computers opened checkSelUnselButtons(); } function processTreeComputer(CSIx,AGID,AGType) { var CmpID = AC_CompStoreArr[CSIx]; var CmpNme = AC_CompStoreArr[CSIx+2]; var CmpDesc = AC_CompStoreArr[CSIx+3]; var SState = AC_CompStoreArr[CSIx+4]; var Opfx = (CurExpGroupIx == LastGroupDisplayed) ? "White" : "I"; var Mpfx = "T"; CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; CCEs += "<tr><td width='25'> </td><td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>"; CCEs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>"; CCEs += "<td width='11' align='center'><img id='xima" + CurExpGroupIx + "_" + CurCmpIx; //if ( SState == "1" ) { // CCEs += "' checked='1' src='images/"; // CCEs += "Checked.gif' width='9' height='9'"; // CmpImg = "sAdminServers.gif"; //} //else { CCEs += "' checked='0' src='images/"; CCEs += "Unchecked.gif' width='9' height='9'"; CmpImg = "Computer.gif"; //} CCEs += " compix='" +CSIx+"' cmpid='"+CmpID+"' agid='"+AGID+"' agt='"+AGType+"' style='cursor:hand' onclick='procELCmpImgClick(this)'></td>"; CCEs += "<td width='19' align='center'><img id='zimb" + CurExpGroupIx + "_" + CurCmpIx + "' src='images/"+CmpImg+"' style='cursor:hand' onclick='procELCmpImgClick(this)' width='15' height='16' title='"; CCEs += CmpDesc + "'></td>"; CCEs += "<td width='*' id='zimc" + CurExpGroupIx + "_" + CurCmpIx; CCEs += "' style='cursor:hand' onclick='procELCmpImgClick(this)' class='optext'>" + CmpNme + "</td>"; CCEs += "</tr></table>"; ++CurCmpIx; // bump index } function SetButtonState(BtObj,BState) { //BtObj.className = (BState == "0") ? "BoxButton" : "BoxButtonD"; BtObj.disabled = (BState == "0") ? "" : "disabled"; BtObj.bdis = BState; } /* Process Click to Check or Uncheck a Computer */ function procELCmpImgClick(CmpIm) { var isx = CmpIm.id; if ( isx.charAt(0) != "x" && isx.charAt(0) != "z") return; var cx = isx.substring(4,isx.length); // Strip off index lx = cx.lastIndexOf("_"); // derive suffix to the Computer DIV ID var dx = cx.substring(0,lx); var CObj = document.all["xima"+cx]; // Clicked Computer Entry var FObj = document.all["zimb"+cx]; CSIx = parseInt(CObj.compix,10); if ( CObj.checked == "1" ) { // if currently Checked, Uncheck FObj.src = "images/Computer.gif"; CObj.src = "images/Unchecked.gif"; CObj.checked = "0"; // Set Unchecked AC_CompStoreArr[CSIx+4] = "0"; } else { // otherwise Check FObj.src = "images/sAdminServers.gif"; CObj.src = "images/Checked.gif"; CObj.checked = "1"; // Set Checked AC_CompStoreArr[CSIx+4] = "1"; } } // Process SelectALL or UnselectALL function processSelect(Pflg) { var GObj = null, CObj = null; // Look for each open/expanded Group for ( var i=0; i<GroupDisplayedCount; i++ ) { GObj = document.all["lima"+i]; if ( GObj.expanded == "1" ) { GObj = document.all["lexp"+i]; // if Group expanded, process each computer for ( var j=0; j<GObj.compcount; j++ ) { CObj = document.all["xima"+i+"_"+j]; // computer entry in tree if (CObj.checked == Pflg) { procELCmpImgClick(CObj); // go process } } } } }